package cn.itcast.pay.web;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@RestController
@RequestMapping("/pay")
@Slf4j
public class PayController {

    @GetMapping("/queryList")
    public List<String> queryList(HttpServletRequest request){
        ArrayList<String> stringArrayList = new ArrayList<String>();
//        String userId = request.getHeader("userId");
//        log.info("[从请求头获取] userId:{}",userId);
//        if (userId!=null){
//            Collections.addAll(stringArrayList,"1","2","3");
//        }
        String message = request.getHeader("message");
        String token = request.getHeader("token");
        System.out.println(message);
        System.out.println(token);
        return stringArrayList;
    }
}
